/*
 * VIPResource.h
 *
 *  Created on: 2014. 3. 7.
 *      Author: the2
 */

#ifndef VIPRESOURCE_H_
#define VIPRESOURCE_H_

#include <map>

namespace ProjectZ { namespace NResource {

class VIPSkillBuffData
{
public:
	struct Flyweight
	{
		Flyweight()
		: _EXP_CONST(-1), _ITEM_DROP_CONST(-1),
		  _SKILL1_TID(-1), _SKILL1_LEVEL(-1),
		  _SKILL1_VALUE(-1), _SKILL2_TID(-1),
		  _SKILL2_LEVEL(-1), _SKILL2_VALUE(-1) {}
		int _EXP_CONST;
		int _ITEM_DROP_CONST;
		int _SKILL1_TID;
		int _SKILL1_LEVEL;
		int _SKILL1_VALUE;
		int _SKILL2_TID;
		int _SKILL2_LEVEL;
		int _SKILL2_VALUE;
	};

public:
	VIPSkillBuffData() {};
	virtual ~VIPSkillBuffData();

	bool LoadResource();
	Flyweight * GetFly(int vipType);

private:
	void Clear();

private:
	typedef std::map<int, Flyweight *>	DATATREE;
	DATATREE clsFlyTree;
};

class VIPResource {
public:
	struct Data
	{
		Data()
		: _VIP1_VP(-1), _VIP2_VP(-1),
		  _VIP3_VP(-1), _MAX_VP(-1),
		  _MINUS_VP_MIN_PERIOD(-1), _MINUS_VP_AMOUNT_PER_PERIOD(-1)
		  {}
		unsigned int _VIP1_VP;
		unsigned int _VIP2_VP;
		unsigned int _VIP3_VP;
		int _MAX_VP;
		int _MINUS_VP_MIN_PERIOD;
		int _MINUS_VP_AMOUNT_PER_PERIOD;
	};

public:
	VIPResource();
	virtual ~VIPResource();

	bool LoadResource();
	Data & GetData() { return _data; }
	VIPSkillBuffData::Flyweight * GetFly(int vipType);

private:
	Data _data;
	VIPSkillBuffData * pVipSkillBuffData;
};

} /* namespace NResource */ } /* namespace ProjectZ */

#endif /* VIPRESOURCE_H_ */
